<?php 
	$shortUrl=trim($_POST['url']);
    $headers = get_headers($shortUrl, TRUE);
    $longUrl=$headers['Location'];
	
	responseMesg(1,'success',$longUrl);
	
	//返回json信息
	function responseMesg($code=0,$message,$data=null){
		$arr=array();
		$arr['code']=$code;
		$arr['message']=$message;
		$arr['data']=$data;
		echo json_encode($arr);
		//结束
		exit();
	}
